package com.tj.test.sys.service.impl;

import com.tj.test.sys.dao.RolerMapper;
import com.tj.test.sys.po.Roler;
import com.tj.test.sys.service.IRolerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class RolerService implements IRolerService {
    @Autowired
    private RolerMapper mapper;
    @Override
    //查询所有角色信息
    public List<Roler> selectAllRoler() {
        List<Roler> list=new ArrayList<>();
        if (mapper.selectAllRoler()!=null)
            list=mapper.selectAllRoler();
        return list;
    }

    @Override
    //根据id查询角色信息
    public Roler selectById(int roleid) {
        Roler roler=new Roler();
        //判断查询数据是否为空
        if (mapper.selectById(roleid)!=null){
        roler=mapper.selectById(roleid);}

        return roler;
    }
}
